import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from "../views/home/Home"
import Login from "../views/login/Login"
import StudentHome from "../views/student/StudentHome"
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect:'/login'
  },
  {
    path: '/login',
    name: 'Login',
    component: Login
  },
  {
    path: '/studentHome',
    name: 'StudentHome',
    component: StudentHome,
    children:[
      {
        path:"/studentHome/tableMain",
        name:"TableMain",
        component:()=>import("../components/main/TableMain")
      },
      {
        path:"/studentHome/readyExam",
        name:"ReadyExam",
        component:()=>import("../views/student/readyExam")
      },
      {
        path:"/studentHome/endExam",
        name:"EndExam",
        component:()=>import("../views/student/EndExam")
      },
      {
        path:"/studentHome/gradesList",
        name:"GradesList",
        component:()=>import("../views/student/GradesList")
      },
      {
        path:"/studentHome/topicList",
        name:"TopicList",
        component:()=>import("../views/manage/TopicList")
      },
      {
        path:"/studentHome/topicSet",
        name:"TopicSet",
        component:()=>import("../views/manage/TopicSet")
      },
      {
        path:"/studentHome/questionBank",
        name:"QuestionBank",
        component:()=>import("../views/manage/QuestionBank")
      },
      {
        path:"/studentHome/userManage",
        name:"UserManage",
        component:()=>import("../views/manage/UserManage")
      },
    ]
  },
  {
    path: '/start/online/Exams',
    name: 'OnlineExams',
    component:()=>import("../views/student/onlineExams")
  }



]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
